"""
These strings are used to build the responses when acting as a CGI server
to provision Aladino VoIP devices.
"""

askcli = """<?xml version="1.0" encoding="UTF-8"?>
<aptcfg:APTData xmlns:aptcfg="http://www.telecomitalia.it/apt-config_version-1" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><aptcfg:ErrorStatus><aptcfg:ErrorCode>3</aptcfg:ErrorCode>
</aptcfg:ErrorStatus><aptcfg:CLIList>
%(cli_list)s</aptcfg:CLIList>
</aptcfg:APTData>"""

cli_entry = """<aptcfg:CLI aptcfg:Status="%(status)s">%(cli)s</aptcfg:CLI>
"""

cli_errorcode_entry = """<aptcfg:ErrorCode aptcfg:CLI="%(cli)s">%(error_code)s</aptcfg:ErrorCode>
"""

cli_parameters_entry = """<aptcfg:SIPTerminalParameters><aptcfg:OutboundProxyIP>%(outbound_proxy)s</aptcfg:OutboundProxyIP>
<aptcfg:LineIdentification>%(cli)s</aptcfg:LineIdentification>
<aptcfg:SIPkey>%(key)s</aptcfg:SIPkey>
<aptcfg:SIPDomain>%(domain)s</aptcfg:SIPDomain>
</aptcfg:SIPTerminalParameters>
"""

setcli = """<?xml version="1.0" encoding="UTF-8"?>
<aptcfg:APTData xmlns:aptcfg="http://www.telecomitalia.it/apt-config_version-1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><aptcfg:ErrorStatus>
%(error_codes)s
</aptcfg:ErrorStatus>
%(parameters)s
</aptcfg:APTData>
"""

setcli_error = """<?xml version="1.0" encoding="UTF-8"?>
<aptcfg:APTData xmlns:aptcfg="http://www.telecomitalia.it/apt-config_version-1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<aptcfg:ErrorStatus><aptcfg:ErrorCode aptcfg:CLI="%(cli)s">%(error_code)s</aptcfg:ErrorCode>
</aptcfg:ErrorStatus>
</aptcfg:APTData>
"""

setcli_success = """<?xml version="1.0" encoding="UTF-8"?>
<aptcfg:APTData xmlns:aptcfg="http://www.telecomitalia.it/apt-config_version-1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><aptcfg:ErrorStatus>
</aptcfg:ErrorStatus>
<aptcfg:SIPTerminalParameters><aptcfg:OutboundProxyIP>%(outbound_proxy)s</aptcfg:OutboundProxyIP>
<aptcfg:LineIdentification>%(cli)s</aptcfg:LineIdentification>
<aptcfg:SIPkey>%(key)s</aptcfg:SIPkey>
<aptcfg:SIPDomain>%(domain)s</aptcfg:SIPDomain>
</aptcfg:SIPTerminalParameters>
</aptcfg:APTData>
"""

delallcli = """<?xml version="1.0" encoding="UTF-8"?>
<aptcfg:APTData xmlns:aptcfg="http://www.telecomitalia.it/apt-config_version-1" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<aptcfg:ErrorStatus><aptcfg:ErrorCode>0</aptcfg:ErrorCode>
</aptcfg:ErrorStatus>
</aptcfg:APTData>
"""
